
### ARDUINO_DIR
### Path to the Arduino application and ressources directory.
#
ARDUINO_DIR = /usr/share/arduino

### ARDMK_DIR
### Path to the Arduino-Makefile directory.
#
ARDMK_DIR = /usr/share/arduino

#AVR_TOOLS_DIR = /usr/lib/avr
AVR_TOOLS_DIR = /usr

### AVRDDUDE
### Path to avrdude directory.
#
#AVRDDUDE = /usr/bin/avrdude

### MCU Name
#
MCU = atmega328p

### BOARD_TAG
### It must be set to the board you are currently using. (i.e uno, mega2560, etc.)
#
BOARD_TAG = uno

### MONITOR_PORT
### The port your board is connected to. 
### Using an '*' tries all the ports and finds the right one.
#
#ARDUINO_PORT = /dev/ttyACM0
#MONITOR_PORT = /dev/tty.usbmodem*
MONITOR_PORT = /dev/ttyACM0

### MONITOR_BAUDRATE
### It must be set to Serial baudrate value you are using.
#
MONITOR_BAUDRATE = 115200

#
# Space-separated set of libraries used by the sketch
#
ARDUINO_LIBS = 

#FREERTOS_DIR = /home/stoa/arduino/FreeRTOSv8.0.1

#
FREERTOS_DIR = /home/stoa/arduino/SVN/trunk/FreeRTOSv8.0.1
LIB_DIR = /home/stoa/arduino/SVN/trunk/lib
#
# List C source files here. (C dependencies are automatically generated.)
SOURCE_DIR = $(FREERTOS_DIR)/FreeRTOS/Source
PORT_DIR = $(FREERTOS_DIR)/FreeRTOS/Source/portable/GCC/ATMega328

#FREERTOS_DIR = /home/stoa/arduino/SVN/trunk/FreeRTOS-Arduino/libraries/FreeRTOS_AVR
#SOURCE_DIR = $(FREERTOS_DIR)/utility
#PORT_DIR = $(FREERTOS_DIR)/utility

#
# The Arduino-Makefile defines these:
#
OPTIMIZATION_LEVEL = s

DEBUG_FLAGS = -g -Wall -Wextra # in order to use this need DEBUG

CPPFLAGS = -I. -I$(SOURCE_DIR)/include -I$(PORT_DIR) -I$(LIB_DIR)/FreeRTOS-Util
#CPPFLAGS = -I. -I$(FREERTOS_DIR)

CFLAGS = -D GCC_MEGA_AVR -I. -I$(SOURCE_DIR)/include -I$(PORT_DIR) -fsigned-char -funsigned-bitfields -fpack-struct -fshort-enums

ASFLAGS = 

LDFLAGS = -Wl,-Map=$(TARGET).map,--cref

#
# The Arduino-Makefile defines this
#
LOCAL_CPP_SRCS = main.cpp $(LIB_DIR)/FreeRTOS-Util/debug.cpp

LOCAL_C_SRCS = 	$(SOURCE_DIR)/tasks.c \
		$(SOURCE_DIR)/queue.c \
		$(SOURCE_DIR)/list.c \
		$(SOURCE_DIR)/portable/MemMang/heap_3.c \
		$(PORT_DIR)/port.c

#main.c Serial.c
#		$(SOURCE_DIR)/croutine.c 
#		$(SOURCE_DIR)/portable/MemMang/heap_1.c 

#$(FREERTOS_DIR)/FreeRTOS_AVR.c
# $(FREERTOS_DIR)/idlehook.c

# Target file name (without extension).
TARGET = helloworld_freertos



include $(ARDMK_DIR)/Arduino.mk
